﻿@model IEnumerable<MagicApp.Models.Card>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

@using (Html.BeginForm("Index", "Cards"))
{
    <p>Name: @Html.TextBox("nameString") Type: @Html.TextBox("typeString")</p>
    <input type="submit" value="Search" /> <input type="reset" value="Clear" />
}

<p>@Html.ActionLink("<<First", "First") @Html.ActionLink("<Previous", "Previous") @Html.ActionLink("Next>", "Next") @Html.ActionLink("Last>>", "Last")</p>

<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.manaCost)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.type)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.rarity)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.power)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.toughness)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.manaCost)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.type)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.rarity)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.power)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.toughness)
        </td>
        <td>
            @Html.ActionLink("Details", "Details", new { id=item.multiverseID })    
        </td>
    </tr>
}

</table>

<p>@Html.ActionLink("<<First", "First", "Cards") @Html.ActionLink("<Previous", "Previous", "Cards") @Html.ActionLink("Next>", "Next", "Cards") @Html.ActionLink("Last>>", "Last", "Cards")</p>
